/**
 * 管理初始化
 */

Grid.controllerName = "/attendance/leave";
Grid.title = "请假申请";
Grid.PrimaryKey = "leId";
Grid.height = "500px";


/**
 * 初始化表格的列
 */
Grid.initColumn = function () {
    var columns = [
        {field: 'selectItem', radio: true},
        {title: 'id', field: 'leId', visible: false, align: 'center', valign: 'middle'},
        {title: '开始时间', field: 'leStrDate', align: 'center', valign: 'middle', sortable: true},
        {title: '结束时间', field: 'leEndDate', align: 'center', valign: 'middle', sortable: true},
        {title: '员工', field: 'leUserName', align: 'center', valign: 'middle', sortable: true},
        {title: '状态', field: 'leStateName', align: 'center', valign: 'middle', sortable: true},
        {title: '类型', field: 'leTypeName', align: 'center', valign: 'middle', sortable: true},
        {title: '原因', field: 'leMemo', align: 'center', valign: 'middle', sortable: true}
    ];
    return columns;
};

Grid.openBatchAdd = function(){
    var index = layer.open({
        type: 2,
        title: Grid.title,
        area: [Grid.width, Grid.height], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Common.ctxPath + Grid.controllerName +'/batch/to_add'
    });
    this.layerIndex = index;
}


$(function () {
    var defaultColunms = Grid.initColumn();
    var table = new BSTable(Grid.id, "/attendance/leave/list", defaultColunms);
    table.setPaginationType("server");
    Grid.table = table.init();

});